package com.jfirer.validator.context;

import javax.validation.ConstraintValidatorContext;
import javax.validation.ConstraintValidatorContext.ConstraintViolationBuilder;
import com.jfirer.validator.path.api.ConnectionNode;

import javax.validation.ElementKind;

class ConstraintViolationBuilderImpl extends BaseContextInfo implements ConstraintViolationBuilder
{
    
    public ConstraintViolationBuilderImpl(String customMessageTemplate, ConnectionNode connectionNode, ConstraintValidatorContextImpl constraintValidatorContextImpl)
    {
        super(customMessageTemplate, connectionNode, constraintValidatorContextImpl);
    }
    
    @Override
    public NodeBuilderDefinedContext addNode(String name)
    {
        ConnectionNode next = connectionNode.next();
        next.setName(name);
        next.setElementKind(ElementKind.PROPERTY);
        next.setInIterable(false);
        return new NodeBuilderDefinedContextImpl(customMessageTemplate, next, constraintValidatorContextImpl);
    }
    
    @Override
    public NodeBuilderCustomizableContext addPropertyNode(String name)
    {
        ConnectionNode next = connectionNode.next();
        next.setName(name);
        next.setElementKind(ElementKind.PROPERTY);
        return new NodeBuilderCustomizableContextImpl(customMessageTemplate, next, constraintValidatorContextImpl);
    }
    
    @Override
    public LeafNodeBuilderCustomizableContext addBeanNode()
    {
        // TODO Auto-generated method stub
        return null;
    }
    
    @Override
    public NodeBuilderDefinedContext addParameterNode(int index)
    {
        // TODO Auto-generated method stub
        return null;
    }
    
    @Override
    public ConstraintValidatorContext addConstraintViolation()
    {
        // TODO Auto-generated method stub
        return null;
    }
    
}
